package com.yhh.xiaohongshuauth.controller;

import com.yhh.framework.biz.operationlog.aspect.ApiOperationLog;
import com.yhh.framework.common.response.Response;
import com.yhh.xiaohongshuauth.model.vo.user.UserLoginReqVO;
import com.yhh.xiaohongshuauth.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date 2025-04-30 10:56
 * @ClassName: UserController
 * @Description: TODO
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Resource
    private UserService userService;

    /**
     * @author Eason
     * @date 2025-04-30 10:57
     * @description: 用户登录注册
    */
    @PostMapping("/login")
    @ApiOperationLog(description = "用户登录/注册")
    public Response loginAndRegister(@Validated @RequestBody UserLoginReqVO userLoginReqVO){
        return userService.loginAndRegister(userLoginReqVO);
    }
}
